﻿//
// Created by francklinson on 2021/3/23.
//

#include <iostream>
using std::cout;
#include "stoneWt.h"
void display(const StoneWt & st, int n);
int main()
{
    StoneWt incognito = 275; // uses constructor to initialize
    StoneWt wolfe(285.7);     // same as StoneWt wolfe = 285.7;
    StoneWt taft(21, 8);

    cout << "The celebrity weighed ";
    incognito.show_stn();
    cout << "The detective weighed ";
    wolfe.show_stn();
    cout << "The President weighed ";
    taft.show_lbs();
    incognito = 276.8; // uses constructor for conversion
    taft = 325;         // same as taft = StoneWt(325);
    cout << "After dinner, the celebrity weighed ";
    incognito.show_stn();
    cout << "After dinner, the President weighed ";
    taft.show_lbs();
    display(taft, 2);
    cout << "The wrestler weighed even more.\n";
    display(422, 2);
    cout << "No stone left unearned\n";


    StoneWt poppins(9,2.8); // 9 stone, 2.8 pounds
    double p_wt = poppins; // implicit conversion
    cout << "Convert to double => ";
    cout << "Poppins: " << p_wt << " pounds.\n";
    cout << "Convert to int => ";
    cout << "Poppins: " << int (poppins) << " pounds.\n";


    return 0;
}

void display(const StoneWt & st, int n)
{
    for (int i = 0; i < n; i++)
    {
        cout << "Wow! ";
        st.show_stn();
    }
}